Professional JavaScript by Philip Kirkbride & Vinicius Isola & Siyuan Gao & Hugo Di Francesco

Professional JavaScript by Philip Kirkbride & Vinicius Isola & Siyuan Gao & Hugo Di Francesco

Author:Philip Kirkbride & Vinicius Isola & Siyuan Gao & Hugo Di Francesco [Philip Kirkbride]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2019-09-29T16:00:00+00:00


Initialize the folder as a Git project:git init

Create the .git/hooks/pre-commit file, which contains the following:#!/bin/sh

npm run lint

If on an OS X- or Linux-based system, make the file executable by running the following (this is not required on Windows):chmod +x .git/hooks/pre-commit

We'll now test the hook by making a commit:git add package.json

git commit -m "testing git hook"

The following is the output of the preceding code:

Figure 6.12: Git hook being run before committing to Git



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.